package com.zhiziai.aiproxy.utils;


import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;

import java.util.Random;

public class UUIDUtil {

    private static final long MAX_VALUE = 999999999999999999L;
    private static final long MIN_VALUE = 100000000000000000L;

    public static long generateUUID() {
        Random random = new Random();
        // 生成一个介于MIN_VALUE和MAX_VALUE之间的随机数
        long uuid = random.nextLong() % (MAX_VALUE - MIN_VALUE) + MIN_VALUE;
        return uuid;
    }

    public static long snowUUID(){
        Snowflake snowflake = IdUtil.getSnowflake(1, 1);
        return snowflake.nextId();
    }

}
